
package util;

import org.hibernate.Session;

import com.e885.hibernate.HibernateSessionFactory;
import com.e885.log.E885Logger;

/**
 * 測試由 HibernateUtil 取得的 Session 是否相同<br>
 * <br>
 * Copyright: Copyright (c) 2001-2008<br>
 * Company: E885 Group
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 */
public class FetchMoreSession
{
	public static void main( String[] args )
	{
		new FetchMoreSession();
	}

	public FetchMoreSession()
	{
		Session session1 = HibernateSessionFactory.getSession();
		Session session2 = HibernateSessionFactory.getSession();

		E885Logger.testLog.debug( "session1:" + session1 );
		E885Logger.testLog.debug( "session2:" + session2 );

		if( session1 == session2 )
			E885Logger.testLog.debug( "session1 and session2 are the same." );
		else
			E885Logger.testLog.debug( "session1 and session2 are the differnet." );

		HibernateSessionFactory.closeSession();
	}

}
